﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using System.Globalization;
using System.Windows;

namespace ClaseBase
{

//[ValueConversion(typeof(object), typeof(String))]
    public class ConversorDedatos:IValueConverter
        
    {
        Object m;
        int valor;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {

            if (value.ToString() != "")
            {
                valor = Int32.Parse((string)value);

                if (valor >= 0 && valor <= 30)
                {
                    //BrushConverter convert = new BrushConverter();
                    //convert.ConvertFrom("");


                    m = Brushes.OrangeRed;
                }
                if (valor > 60 )
                {




                    m = Brushes.Red;
                }
                if (valor < 0 && valor >= -60)
                {



                    m = Brushes.GreenYellow;
                   
                }
                if (valor < -30)
                {


                    m = Brushes.Green;

                   
                }


                

            }
            return m;

        }



        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }


    
    }
}
